import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-10-20
 * Time: 18:38
 */
class Sort {
    /**
     *  宝石与石头
     * @param jewels
     * @param stones
     * @return
     */
    public int numJewelsInStones(String jewels, String stones) {
        HashSet<Character> set = new HashSet<>();
        //找宝石放进set里面
        for(int i = 0; i < jewels.length(); i++) {
            set.add(jewels.charAt(i));
        }
        //石头里找宝石，有++
        int count = 0;
        for(int i = 0; i < stones.length(); i++) {
            if(set.contains(stones.charAt(i))) {
                count++;
            }
        }
        return count;
    }
    /**
     *只出现一次的数字
     */
    public int singleNumber(int[] nums) {
        HashSet<Integer> set = new HashSet<>();
        for(int x : nums) {
            if(!set.contains(x)) {
                set.add(x);
            } else {
                set.remove(x);
            }
        }
        //集合中只有一个元素了
        for(int x : nums) {
            if(set.contains(x)) {
                return x;
            }
        }
        return -1;
    }
    /**
     * 坏键盘打字
     * @param args
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String str1 = new String();
        String str2 = new String();
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            str1 = in.nextLine();
            str2 = in.nextLine();

        }
        func(str1, str2);
    }
    public static void func(String str1, String str2) {
        HashSet<Character> set1 = new HashSet<>();
        HashSet<Character> set2 = new HashSet<>();
        //遍历输出的键，放进set1
        for(char ch : str2.toUpperCase().toCharArray()) {
            set1.add(ch);
        }
        //遍历输入的键，要是没有set1里面没有，那就是坏键
        for(char ch : str1.toUpperCase().toCharArray()) {
            if(!set1.contains(ch) && !set2.contains(ch)) {
                System.out.print(ch);
                set2.add(ch);
            }
        }
    }
}
class Student {
    public String id;

    public Student(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(id, student.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class Test {

    public static void main(String[] args) {
        Student student1 = new Student("67891");
        Student student2 = new Student("67891");
        System.out.println(student1.hashCode());
        System.out.println(student2.hashCode());

        HashMap<Student, Integer> map = new HashMap<>();

        map.put(student1, 20);
        System.out.println(map.get(student2));
    }
    public static void main1(String[] args) {
        HashMap<String, Integer> map = new HashMap<>();

        map.put("hello", 2);
        map.put("abcd", 10);
        map.put("gao",3);

        Integer val = map.get("gao");
        System.out.println(val);
        System.out.println(map);
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println("key: " + entry.getKey() + " val:"+ entry.getValue());
        }

    }
}
